package com.cimu.provider.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.cimu.provider.entity.User;
import com.cimu.provider.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * Title: UserServiceImpl
 * Copyright: Copyright (c) 2017
 *
 * date 2018年12月06日 13:23
 */
@Service(interfaceClass = UserService.class, registry = {"test"})
@Component
@Slf4j
public class UserServiceImpl implements UserService{

    @Override
    public User getById(Long id) {
        log.info("========获取用户信息=============");
        User user = new User();
        user.setId(id);
        user.setMobile("135xxxxxxx");
        return user;
    }

    @Override
    public List<User> selectAll() {
        List<User> users = new ArrayList<>();
        User user = new User();
        user.setId(1L);
        user.setMobile("135xxxxxxx");
        users.add(user);
        User user2 = new User();
        user2.setId(1L);
        user2.setMobile("135xxxxxxx");
        users.add(user2);
        return users;
    }

}
